<!-- 领导选人 -->
 <template>
  <el-dialog :visible.sync="visible" v-dialogDrag :title="title" :close-on-click-modal="false" class="tl-dialog" width="1200px" @open="open" @close="close">
    <el-form class="tl-form" ref="form" :model="model" :rules="rules" label-width="150px" :disabled="true">
      <el-row>
        <el-col :span="24">
          <el-form-item label="关注人员" prop="markedperson">
            <el-input v-model="model.markedperson" type="textarea" :rows="4" maxlength="1000" show-word-limit></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="doCancelEdit">取消</el-button>
    </div>
  </el-dialog>
</template>

<script>
/** mixins */
import { mixin_edit } from '@tapui/mixins/mixin_edit'

/** 子组件 */
/** 工具类 */
import { putAction, getAction, postAction, deleteAction } from '@tapui/utils/http'
import refListVue from '../pmIndexTabPermission/refList.vue'
import { validateNull } from '@tapui/utils/validate'
/** VUE配置 */
export default {
  mixins: [mixin_edit],
  components: {},
  data() {
    return {
      moduleTitle: '项目关注人员',
      urlPrefix: '/mpm/projectCirculated/',
      url: {
        queryMarkedInfo: '/mpm/project/queryMarkedInfo'
      },
      isAdd: false,
      projectId: 0,
      noinfo: '暂无关注人员'
    }
  },
  methods: {
    open() {
      this.model = {}
      this.$nextTick(() => {
        this.$refs.form.clearValidate()
        this.title = '查看' + this.moduleTitle
          this.queryMarkedInfo(this.projectId).then((_) => {
            this.$refs.form.clearValidate()
          })
      })
    },
    queryMarkedInfo(projectId) {
      return getAction(this.url.queryMarkedInfo, { projectId: projectId, sourcetype: 'MpmProject' }).then((res) => {
        if (res.success) {
          this.model = res.result
          validateNull(this.model.markedperson) ? this.$set(this.model, 'markedperson', this.noinfo) : null
        } else {
          this.$tap.alert(res.message, 'warning')
        }
      })
    }
  }
}
</script>

